<?php
/**
 * Created by zhangyh.
 * User: zhangyh
 * Date: 2018/11/3
 * Time: 14:11
 */




$api = app('Dingo\Api\Routing\Router');
$api->version('v1', ['namespace' => 'App\Http\Controllers\Api\V1','middleware' => 'api'], function ($api) {

    $api->get('/index', 'IndexController@index');   //首页

    $api->match(['get','post'],'/index/serviceAuthorization', 'IndexController@serviceAuthorization');   //服务授权
    $api->match(['get','post'],'/index/getCDNInfo', 'IndexController@getCDNInfo');   //获取cdn信息
    $api->match(['get','post'],'/index/setFile', 'IndexController@setFile');   //设置图片

    $api->match(['get','post'],'/activity/attendActivity', 'ActivityController@attendActivity');   //参加活动
    $api->match(['get','post'],'/activity/getRecord', 'ActivityController@getRecord');   //获取单个人参加活动的信息
    $api->match(['get','post'],'/activity/recommend', 'ActivityController@recommend');   //获取活动详情推荐信息
    $api->match(['get','post'],'/activity/ranking', 'ActivityController@ranking');   //获取排行榜
    $api->match(['get','post'],'/activity/recordInfo', 'ActivityController@recordInfo');   //参与详情
    $api->match(['get','post'],'/activity/attendLog', 'ActivityController@attendLog');   //参与记录

    /**
     * 关注相关接口
     * @author 许立 2018年11月06日
     */
    $api->match(['get','post'],'/member/followList', 'MemberController@followList');   // 关注的好友列表
    $api->match(['get','post'],'/member/follow', 'MemberController@follow');   // 关注 取消关注

});

$api->version('v1', ['namespace' => 'App\Http\Controllers\Api\V1'], function ($api) {

    $api->match(['get','post'],'/index/login', 'IndexController@login');//用户登陆
    $api->match(['get','post'],'/index/isTokenExpire', 'IndexController@isTokenExpire');   //token是否过期
});